<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>页面导航</strong></div>
        <div class="padding border-bottom">
            <a href="{:U('index')}" class="button button-small border-green">管理</a>
            <a href="JavaScript:void(0);" class="button button-small border-green">新增广告位</a>
        </div>
        <div class="fixed-empty"></div>
        <form id="myform" name="myform" method="post" action="{:U('edit',array('ap_id'=>$ap['ap_id']))}">
            <table class="table tb-type2">
                <tbody>
                    <tr>
                        <td class="required"><label class="validation" for="ap_name">名称:</label></td>
                        <td class="vatop rowform"><input type="text" name="ap_name" id="ap_name" class="input input_big" value="{$ap['ap_name']}"></td>
                        <td class="vatop tips"></td>
                    </tr>
                    <tr>
                        <td class="required"><label class="validation" for="ap_name">简介:</label></td>
                        <td class="vatop rowform"><textarea class="input input_big" id="sg_description" name="ap_intro">{$ap['ap_intro']}</textarea></td>
                        <td class="vatop tips"></td>
                    </tr>
                    <tr>
                        <td class="required"><label>类别:</label></td>
                        <td class="vatop rowform"><select name="ap_class" class="querySelect" id="ap_class">
                                <option value="0" {$ap_class[0]}>图片</option>
                                <option value="1" {$ap_class[1]}>文字</option>
                                <option value="3" {$ap_class[3]}>Flash</option>
                            </select>
                        </td>
                        <td class="vatop tips">选择此广告位广告的形式</td>
                    </tr>
                    <tr>
                        <td class="required">是否启用:</td>
                        <td class="vatop rowform">
                            <div class="form-group">
                                <div class="field">
                                    <div class="button-group radio">
                                        <label class="button">
                                            <input name="is_use" value="1" checked="checked" type="radio"><span class="icon icon-check"></span> 启用
                                        </label>
                                        <label class="button active">
                                            <input name="is_use" value="0"  type="radio"><span class="icon icon-check"></span> 不启用
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </td>
                        <td class="vatop tips"></td>
                    </tr>
                </tbody>
                <tbody id="ap_display">
                    <tr>
                        <td class="required">展示方式:</td>
                        <td class="vatop rowform">
                            <div class="form-group">
                                <div class="field">
                                    <div class="button-group radio">
                                        <label class="button">
                                            <input name="ap_display" value="1"  type="radio"><span class="icon icon-check"></span> 发布多条广告
                                        </label>
                                        <label class="button active">
                                            <input name="ap_display" value="2" checked="checked" type="radio"><span class="icon icon-check"></span> 发布一条广告
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </td>
                        <td class="vatop tips"></td>
                    </tr>
                </tbody>
                <tbody id="ap_width_media">
                    <tr>
                        <td class="required"><label class="validation" for="ap_width_media_input">宽度:</label></td>
                        <td class="vatop rowform"><input type="text" value="{$ap['ap_width']}" name="ap_width_media"  class="input input_big" id="ap_width_media_input"></td>
                        <td class="vatop tips">像素</td>
                    </tr>
                <tbody id="ap_width_word">
                    <tr>
                        <td class="required"><label class="validation" for="ap_width_word_input">字数:</label></td>
                        <td class="vatop rowform"><input type="text" value="{$ap['ap_width']}" name="ap_width_word"  class="input input_big" id="ap_width_word_input"></td>
                        <td class="vatop tips">个字</td>
                    </tr>
                </tbody>
                <tbody id="ap_height">
                    <tr>
                        <td class="required"><label class="validation" for="ap_height_input">高度:</label></td>
                        <td class="vatop rowform"><input type="text" value="{$ap['ap_height']}" name="ap_height" class="input input_big" id="ap_height_input"></td>
                        <td class="vatop tips">像素</td>
                    </tr>
                </tbody>
                <tbody id="default_pic">
                    <tr>
                        <td class="required"><label class="validation" for="change_default_pic">广告位默认图片:</label></td>
                        <td class="vatop rowform type-file-box" style="height: 200px;">
                            <!-- 图片上传按钮 -->
                            <a class="button input-file bg-blue" href="javascript:void(0);">+ 浏览文件
                            <input class="fileupload" type="file" name="image" data-name="default_content" data-num="1">
                            </a>
                            <!-- 图片展示模块 -->
                            <div class="files">
                                <div class="images_zone">
                                    <input type="hidden" name="default_content" value="{$ap['default_content']}">
                                    <span>
                                        <img src="{$ap['default_content']}!100x100">
                                    </span>
                                    <a href="javascript:;" style="display: none;">删除</a>
                                </div>
                            </div>
                            <div style="clear:both;"></div>
                            <!-- 图片上传进度条模块 -->
                            <div class="up_progress"><div class="progress-bar"></div></div>
                        </td>
                        <td class="vatop tips">当没有广告可供展示时使用的默认图片,系统支持的图片格式为:gif,jpg,jpeg,png</td>
                    </tr>
                </tbody>
                <tbody id="default_word">
                    <tr>
                        <td class="required"><label for="default_word" class="validation">广告位默认文字:</label></td>
                        <td class="vatop rowform">
                            <input type="text" id="default_word" value="{$ap['default_content']}" name="default_word" class="input input_big">
                        </td>
                        <td class="vatop tips">当没有广告可供展示时使用的默认文字</td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr class="tfoot">
                        <td colspan="3" ><a href="JavaScript:void(0);" class="button bg-main" id="submitBtn"><span>提交</span></a></td>
                    </tr>
                </tfoot>
            </table>

        </form>
    </div>
</div>
<script type="text/javascript">
    $('#myform').layer({});

    $("#submitBtn").click(function () {
        $('#myform').submit();
    });
    $("#ap_class").change(function () {
        onlondshow();
    });
    function onlondshow() {
        if ($("#ap_class").val() == '1') {
            $("#ap_height").hide();
            $("#ap_width_media").hide();
            $("#default_pic").hide();
            $("#default_word").show();
            $("#ap_width_word").show();
            $("#ap_display").show();
        } else if ($("#ap_class").val() == '0' || $("#ap_class").val() == '3') {
            $("#ap_height").show();
            $("#ap_width_media").show();
            $("#default_pic").show();
            $("#default_word").hide();
            $("#ap_width_word").hide();
            $("#ap_display").show();
        }
    }
    onlondshow();
</script>
<!--F 上传图片-->
<script type="text/javascript" src="__JS__/jquery.uploads.js"></script>
<!--F 上传图片-->